<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/12/8
 * Time: 10:32
 */

include "config.php";
if(isset($_REQUEST["name"])&&isset($_REQUEST["pwd"])){
    $CTEL=$_REQUEST["name"];
    $CPWD=$_REQUEST["pwd"];
    $sql="SELECT *FROM  `userinfo` WHERE u_tel=? AND u_pwd=?;";
    $stmt=$conn->prepare($sql);
    $stmt->bind_param("ss", $CTEL,$CPWD);
    $stmt->execute();
    $res=$stmt->get_result();
    //print_r($res);
    if($res->num_rows>=1){
        // $_SESSION["userInfo"]=$res->fetch_assoc();
         print_r(json_encode(array("status"=>1,"msg"=>"登录成功")));
     }else{
         print_r(json_encode(array("status"=>-1,"msg"=>"手机号或密码错误")));
     }
    }